package net.jarang.support.clock;

public class FrozenClock extends Clock {
	private long now;

	public FrozenClock() {
		this(System.currentTimeMillis());
	}
	
	public FrozenClock(long now) {
		this.now = now;
	}
	
	public long now() {
		return now;
	}

	public void set(long now) {
		this.now = now;
	}

	public void forward(long milliSecond) {
		now += milliSecond;
	}

	public void backward(long milliSecond) {
		now -= milliSecond;
	}

	public void forwardDays(int days) {
		forward(days * DAYS);
	}

	public void backwardDays(int days) {
		backward(days * DAYS);
	}
}